(Fkill_all_local_variables): Store each var's current value
authorRichard M. Stallman <rms@gnu.org>
Thu, 8 Apr 1993 07:10:42 +0000 (07:10 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 8 Apr 1993 07:10:42 +0000 (07:10 +0000)
in the buffer's alist entry, before reverting to the default value.

src/buffer.c

index 118519f36ff9782cc7b473ef77287ceb640a1b37..e927a27088c7e95cd3991dd20c2a6bc063403732 100644 (file)
@@ -1149,8 +1149,16 @@ a non-nil `permanent-local' property are not eliminated by this function.")
             Set it up for the current buffer with the default value.  */
 
          tem = XCONS (XCONS (XSYMBOL (sym)->value)->cdr)->cdr;
+         /* Store the symbol's current value into the alist entry
+            it is currently set up for.  This is so that, if the
+            local is marked permanent, and we make it local again below,
+            we don't lose the value.  */
+         XCONS (XCONS (tem)->car)->cdr = XCONS (XSYMBOL (sym)->value)->car;
+         /* Switch to the symbol's default-value alist entry.  */
          XCONS (tem)->car = tem;
+         /* Mark it as current for the current buffer.  */
          XCONS (XCONS (XSYMBOL (sym)->value)->cdr)->car = Fcurrent_buffer ();
+         /* Store the current value into any forwarding in the symbol.  */
          store_symval_forwarding (sym, XCONS (XSYMBOL (sym)->value)->car,
                                   XCONS (tem)->cdr);
        }